sendgrid send email to multiple recipients python

43

from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import *

message = Mail(
    from_email='[email protected]',
    to_emails=[To('[email protected]'), To('[email protected]')],
    subject='Subject line',
    text_content='This is the message of your email',
)

sg = SendGridAPIClient(SENDGRID_API_KEY)
response = sg.send(message)

Comments

Submit
0 Comments